/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: 
 * License Type: Evaluation
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="resource")
public class Resource implements Serializable {
	public Resource() {
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_RESOURCE_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_RESOURCE_ID_GENERATOR", strategy="native")	
	private int id;
	
	@Column(name="name", nullable=false, length=255)	
	private String name;
	
	@Column(name="pattern", nullable=false, length=255)	
	private String pattern;
	
	@Column(name="httpmethod", nullable=false, length=255)	
	private String httpmethod;
	
	@Column(name="remark", nullable=true, length=255)	
	private String remark;
	
	@Column(name="enabled", nullable=true)	
	private Byte enabled;
	
	@ManyToMany(targetEntity=cn.imvc.app.entities.Role.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@JoinTable(name="role_resource", joinColumns={ @JoinColumn(name="resourceid") }, inverseJoinColumns={ @JoinColumn(name="roleid") })	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	private java.util.Set role = new java.util.HashSet();
	
	private void setId(int value) {
		this.id = value;
	}
	
	public int getId() {
		return id;
	}
	
	public int getORMID() {
		return getId();
	}
	
	public void setName(String value) {
		this.name = value;
	}
	
	public String getName() {
		return name;
	}
	
	public void setPattern(String value) {
		this.pattern = value;
	}
	
	public String getPattern() {
		return pattern;
	}
	
	public void setHttpmethod(String value) {
		this.httpmethod = value;
	}
	
	public String getHttpmethod() {
		return httpmethod;
	}
	
	public void setRemark(String value) {
		this.remark = value;
	}
	
	public String getRemark() {
		return remark;
	}
	
	public void setEnabled(byte value) {
		setEnabled(new Byte(value));
	}
	
	public void setEnabled(Byte value) {
		this.enabled = value;
	}
	
	public Byte getEnabled() {
		return enabled;
	}
	
	public void setRole(java.util.Set value) {
		this.role = value;
	}
	
	public java.util.Set getRole() {
		return role;
	}
	
	
	public String toString() {
		return String.valueOf(getId());
	}
	
}
